

def index
  @<%= instance_obj %> = <%= active_record_class %>.page params[:page]
end

def new
    @<%= instance_obj %> = <%= active_record_class %>.new
end

def create
  <%= active_record_class %>.create strong_params
  redirect_to action: 'index'
end

def edit
  @<%= instance_obj %> = <%= active_record_class %>.find params[:id]
end

def show
end

def update
  <%= active_record_class %>.find(params[:id]).update_attributes strong_params
  redirect_to action: 'index'
end

def destroy
  <%= active_record_class %>.find(params[:id]).destroy
  redirect_to action: 'index',page: params[:page]
end

private
def strong_params
  params.require(:<%= singular_table_name %>).permit(<%= active_record_class %>.attribute_names)
end